<template>
  <el-card>
    <div class="box">
      <img :src="userStore.avatar" alt="" class="avatar" />
      <div>
        <h3 class="title">{{ homeInfo }}</h3>
        <p>商品甄选运营平台</p>
      </div>
    </div>
  </el-card>
  <div class="bottom">
    <svg-icon name="welcome" width="500px" height="500px"></svg-icon>
  </div>
</template>

<script setup lang="ts">
// 引入生命周期函数
import { onMounted } from 'vue'
// 获取仓库对象
import useUserStore from '@/store/modules/user'
import { getTime } from '@/utils/time'
const userStore = useUserStore()
let homeInfo = getTime() + '好,' + userStore.username
// 首页挂载完毕发请求获取用户信息
onMounted(() => {
  userStore.userInfo()
})
</script>

<style scoped lang="scss">
.box {
  display: flex;
  align-items: center;
  .avatar {
    width: 180px;
    height: 180px;
    border-radius: 50%;
  }
  div {
    margin-left: 20px;
    .title {
      font-size: 35px;
    }
    p {
      font-size: 16px;
      margin-top: 10px;
      font-style: italic;
    }
  }
}
.bottom {
  display: flex;
  align-items: center;
  justify-content: center;
}
</style>